#ifndef TIMEVIEW_H
#define TIMEVIEW_H

#include "viewobject.h"
#include "paramobject.h"
#include <QLabel>
#include <QMovie>
#include <qdom.h>
#include <QTimer>

typedef struct TimeParam
{
    QString     m_style;
    QString     m_timeFormat;
    TimeParam()
    {
        m_timeFormat = "";
        m_style = "";
    }
}TimeParam;

typedef struct TimeViewParam
{
    TimeParam       m_datetime;
}TimeViewParam;



class  TimeView:public ViewObject
{
    Q_OBJECT
public:
    static int m_id;
    Q_INVOKABLE explicit TimeView(QWidget *parent = 0);
    ~TimeView();

    void ShowObject();

    void GetAttribute(std::string&);

    void SetAttribute(std::string);

    void ParseXML(QDomElement* );

    void PacketXML(QDomElement*);

    QString GetTimeStrFromFormat(QDateTime datetime, QString format);

public slots:
    void TimeOutSlot();
private:
    QTimer*                             m_timer;
    QLabel*                             m_labelTime;
    QString                             m_timeStr;
    TimeViewParam*                      m_timeViewParam;
};

#endif // TIMEVIEWOBJECT_H
